<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>单据</title>
    <style>
        body{
            width: 940px;
            height:380px;
            border:2px dimgray solid
        }
        table{
            width: 800px;
            height: 300px;

            text-align: center;
            /* 表边框合并  两个单元格之间的边框进行合并 */
            border-collapse: collapse;
            margin: 0 auto;

        }

        table td, th{
            border:1px black solid;
            background-color: white;
            height:20px;
            width: 100px;

        }
        .a{
            border:none;
            text-align: right;
        }
        .b{
            text-align: left;
            padding-left: 10px;
        }
        .c{

            text-align:center
        }

        .d{
            border:none;
            text-align: center;
            padding-top:5px ;
        }

    </style>
</head>
<body>

<table>
    <caption><h2>租金单</h2></caption>
    <tr>
        <td colspan="4" class="a">报销日期&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;月&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日</td>
        <td colspan="2"class="a">附件&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;张&nbsp;&nbsp;&nbsp;&nbsp;</td>

    </tr>
    <tr>
        <td colspan="2">费用项目</td>
        <td colspan="1">类别</td>
        <td>金额</td>
        <td rowspan="2">负责人（签名，盖章）</td>
        <td rowspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    </tr>
    <tr>
        <td colspan="2">租金/{{\App\Models\Owner::$cycleUnitMap[$bill->owner->cycle_unit]}}</td>
        <td>固定金额</td>
        <td>{{$bill->rent}}</td>
    </tr>
    <tr>
{{--        @dd($bill->toArray())--}}
        <td colspan="2">{{isset($bill->other_amount[0]) ? $bill->other_amount[0]['name'] . '/' . $bill->other_amount[0]['unit'] : ''}}</td>
        <td>{{isset($bill->other_amount[0]) ? \App\Models\HouseFeeConfig::$typeMap[$bill->other_amount[0]['type']] : ''}}</td>
        <td>{{isset($bill->other_amount[0]) ? $bill->other_amount[0]['fee'] : ''}}</td>
        <td class="c" rowspan="2">备注</td>
        <td rowspan="2"></td>
    </tr>
    <tr>
        <td colspan="2">{{isset($bill->other_amount[1]) ? $bill->other_amount[1]['name'] . '/' . $bill->other_amount[1]['unit'] : ''}}</td>
        <td>{{isset($bill->other_amount[1]) ? \App\Models\HouseFeeConfig::$typeMap[$bill->other_amount[1]['type']] : ''}}</td>
        <td>{{isset($bill->other_amount[1]) ? $bill->other_amount[1]['fee'] : ''}}</td>
    </tr>
    <tr>
        <td colspan="2">{{isset($bill->other_amount[2]) ? $bill->other_amount[2]['name'] . '/' . $bill->other_amount[2]['unit'] : ''}}</td>
        <td>{{isset($bill->other_amount[2]) ? \App\Models\HouseFeeConfig::$typeMap[$bill->other_amount[2]['type']] : ''}}</td>
        <td>{{isset($bill->other_amount[2]) ? $bill->other_amount[2]['fee'] : ''}}</td>
        <td rowspan="2">租客（签名）</td>
        <td rowspan="2"></td>
    </tr>
    <tr>
        <td colspan="2">{{isset($bill->other_amount[3]) ? $bill->other_amount[3]['name'] . '/' . $bill->other_amount[3]['unit'] : ''}}</td>
        <td>{{isset($bill->other_amount[3]) ? \App\Models\HouseFeeConfig::$typeMap[$bill->other_amount[3]['type']] : ''}}</td>
        <td>{{isset($bill->other_amount[3]) ? $bill->other_amount[3]['fee'] : ''}}</td>
    </tr>
    @if(isset($bill->once) && count($bill->once) > 0)
        @foreach($bill->once as $key => $value)
        <tr>
            <td colspan="2">{{isset($bill->once[$key]) ? $bill->once[$key]['name'] . '每期' : ''}}</td>
            <td>{{isset($bill->once[$key]) ? "每期收费" : ''}}</td>
            <td>{{isset($bill->once[$key]) ? $bill->once[$key]['fee'] : ''}}</td>
            <td class="b"></td>
            <td></td>
        </tr>
        @endforeach
    @endif
    <tr>
        <td colspan="2">合计</td>
        <td></td>
        <td>{{$bill->total_amount}}</td>
        <td class="b">￥</td>
        <td></td>
    </tr>

    <tr>
        <td class="c" colspan="6">核实金额（大写）&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;佰&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;拾&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;万&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;仟&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;佰&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;拾&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;角&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;分&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;￥&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    </tr>
    <tr>
        <td >借款额</td>
        <td ></td>
        <td >应退金额</td>
        <td ></td>
        <td >应补金额</td>
        <td ></td>
    </tr>
    <tr>
        <td colspan="3" class="d">审核</td>
        <td colspan="3" class="d">出纳</td>
</table>

</body>
</html>
